package com.iknow.db;

import android.content.Context;
import android.database.Cursor;
import android.provider.BaseColumns;
import com.iknow.xmpp.service.Friend;

public class FriendTable
  implements BaseColumns
{
  public static final String CREATE_TABLE = "create table roster (jid text primary key on conflict replace, name text, avatar text, qingbo_count text, roster_count text, sex text, career text, flag text,description text,signature text,favorite_count text,word_count text,longitude text,latitude text,distance text,subscribe_tag text,subscribe_mode integer)";
  public static final String DESCRIPTION = "description";
  public static final String DISTATNCE = "distance";
  public static final String FAVORITE_COUNT = "favorite_count";
  public static final String LATITUDE = "latitude";
  public static final String LONGTITUE = "longitude";
  public static final String QINGBO_COUNT = "qingbo_count";
  public static final String ROSTER_AVATAR = "avatar";
  public static final String ROSTER_CARRER = "career";
  public static final String ROSTER_COUNT = "roster_count";
  public static final String ROSTER_FLAG = "flag";
  public static final String ROSTER_ID = "jid";
  public static final String ROSTER_NAME = "name";
  public static final String ROSTER_SEX = "sex";
  public static final String SIGNATRURE = "signature";
  public static final String SUBSCRIBLE_MODE = "subscribe_mode";
  public static final String SUBSCRIBLE_TAG = "subscribe_tag";
  public static final String[] TABLE_COLUMNS;
  public static final String TABLE_NAME = "roster";
  public static final String TAG = "FriendDataBase";
  public static final String WORD_COUNT = "word_count";
  public Context ctx = null;

  static
  {
    String[] arrayOfString = new String[17];
    arrayOfString[0] = "jid";
    arrayOfString[1] = "name";
    arrayOfString[2] = "avatar";
    arrayOfString[3] = "qingbo_count";
    arrayOfString[4] = "roster_count";
    arrayOfString[5] = "sex";
    arrayOfString[6] = "career";
    arrayOfString[7] = "flag";
    arrayOfString[8] = "description";
    arrayOfString[9] = "signature";
    arrayOfString[10] = "favorite_count";
    arrayOfString[11] = "word_count";
    arrayOfString[12] = "longitude";
    arrayOfString[13] = "latitude";
    arrayOfString[14] = "distance";
    arrayOfString[15] = "subscribe_tag";
    arrayOfString[16] = "subscribe_mode";
    TABLE_COLUMNS = arrayOfString;
  }

  public static Friend parseCursor(Cursor paramCursor)
  {
    Friend localFriend = new Friend(paramCursor.getString(paramCursor.getColumnIndex("jid")), "", paramCursor.getString(paramCursor.getColumnIndex("name")), paramCursor.getString(paramCursor.getColumnIndex("avatar")), paramCursor.getString(paramCursor.getColumnIndex("description")), paramCursor.getString(paramCursor.getColumnIndex("signature")), paramCursor.getString(paramCursor.getColumnIndex("sex")), paramCursor.getString(paramCursor.getColumnIndex("favorite_count")), paramCursor.getString(paramCursor.getColumnIndex("word_count")), paramCursor.getString(paramCursor.getColumnIndex("subscribe_tag")));
    localFriend.setTags(paramCursor.getString(paramCursor.getColumnIndex("flag")));
    localFriend.setLongitudeAndLatitude(paramCursor.getDouble(paramCursor.getColumnIndex("longitude")), paramCursor.getDouble(paramCursor.getColumnIndex("latitude")));
    localFriend.setIsMyFriend("1");
    return localFriend;
  }
}